unit FormSelWorker;

interface

uses
    Windows,
    Messages,
    SysUtils,
    Variants,
    Classes,
    Graphics,
    Controls,
    Forms,
    Dialogs,
    StdCtrls,
    ExtCtrls,
    FrameSelWorker,
    LS_CONSTS;

type
    TfrmSelWorker = class(TForm)
        procedure FormKeyPress(Sender: TObject; var Key: Char);
        procedure FormShow(Sender: TObject);
    private
        { Private declarations }
    public
        Frame: TfrmeSelWorker;
        constructor Create(Sender: TComponent; tsw: TTypeSelWorker; id_worker_two: integer = 0); reintroduce;
        procedure GetWorkerData(var wInd: integer; var wName, wLastName, wPatr: string);

    end;

var
    frmSelWorker: TfrmSelWorker;

implementation

{$R *.dfm}

constructor TfrmSelWorker.Create(Sender: TComponent; tsw: TTypeSelWorker; id_worker_two: integer = 0);
begin
    inherited Create(Sender);
    Frame := TfrmeSelWorker.Create(Sender, tsw, id_worker_two);
    Frame.Parent := self;
end;

procedure TfrmSelWorker.GetWorkerData(var wInd: integer; var wName,
    wLastName, wPatr: string);
begin
    Frame.GetWorkerData(wInd, wName, wLastName, wPatr);
end;

procedure TfrmSelWorker.FormKeyPress(Sender: TObject; var Key: Char);
begin
    if (Key = #13) then Frame.Button1.Click;
end;

procedure TfrmSelWorker.FormShow(Sender: TObject);
begin
    if Frame.pEmployee.Visible then Frame.cxgrEmployee.SetFocus;
    if Frame.pStock.Visible then Frame.cxgrStock.SetFocus;
end;

end.

